﻿@using Apps.Web.Core;
@using Apps.Common;
@using Apps.Models.PUB;
@using Apps.Web;
@using Apps.Locale;
@using Apps.Models.Sys;
@using Apps.Models.Enum;
@{
    ViewBag.Title = "审核";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
    List<permModel> perm = null;
    string itemId = ViewBag.itemId as string;
    string formIds = ViewBag.formIds as string;
}
<div class="mvctool bgb">
    @Html.ToolButton("btnSave", "fa fa-save", Resource.Save, ref perm, "Save", true)
    @Html.ToolButton("btnReturn", "fa fa-reply", Resource.Reply, false)
</div>
<script type="text/javascript">
    $(function () {
        $("#btnSave").click(function () {
            var ExamineRemark = $("#ExamineRemark").val();
            var chExamine = $('input:radio:checked').val();
            if (chExamine == -1)
            {
                if (ExamineRemark == "") {
                    $.messageBox5s(Lang.Tip, '请填写审核不通过的说明');
                    return;
                }
            }
            if ($("form").valid()) {
                $.ajax({
                    url: "@Url.Action("Examine")?itemId=" + $("#itemId").val() + "&formIds=" + $("#formIds").val() + "",
                    type: "Post",
                    data: $("form").serialize(),
                    dataType: "json",
                    success: function (data) {
                        if (data.type == 1) {
                            window.parent.frameReturnByMes(data.message);
                            window.parent.frameReturnByReload(true);
                            window.parent.frameReturnByClose()
                        }
                        else {
                            window.parent.frameReturnByMes(data.message);
                        }
                    }
                });
            }
            return false;
        });
        $("#btnReturn").click(function () {
            window.parent.frameReturnByClose();
        });
    });
</script>
@using (Html.BeginForm())
{
    <input type="hidden" id="itemId" value="@itemId" />
    <input type="hidden" id="formIds" value="@formIds" />
    <table class="formtable">
        <tbody>
            <tr>
                <th>
                    审核结果：
                </th>
                <td>
                    <input name="Examine" checked="checked" value="1" type="radio" autocomplete="off">通过
                    <input name="Examine" type="radio" value="-1" autocomplete="off">不通过
                </td>
            </tr>
            <tr>
                <th>
                    审核说明：
                </th>
                <td>
                    <textarea cols="20" id="ExamineRemark" name="ExamineRemark" rows="2" style="width:200px;height:50px;" autocomplete="off"></textarea>
                </td>
            </tr>
        </tbody>
    </table>
    @Html.ValidationSummary()
}

